package cn.edu.scau.cmi.lvmingyan.compositeSafety;

import java.util.ArrayList;
import java.util.List;

public class Term extends Organization {
	public List<Organization> List_child=new ArrayList<>();
	
	public Term(String n){
		name=n;
		flag=1;
	}
	
	public Organization getChild(int i) {
		return List_child.get(i-1);
	}
	
	public void add(Organization o) {
		List_child.add(o);
		System.out.println(o.getName()+"successful to add");
	}
	
	public void delect(int i) {
		List_child.remove(i-1);
		System.out.printf("the %dth child is successful to delect\n",i);
	}
}
